<?php

use think\facade\Route;

Route::group('index', function () {
    Route::rule('index', 'index')->name('index_index');
    Route::rule('login', 'login')->name('index_login');
    Route::rule('logout', 'logout')->name('index_logout');
})->prefix('admin/index/');

Route::group('ajax', function () {
    Route::rule('cacheClaer', 'cacheClear')->name('ajax_cache_clear');
    Route::rule('upload', 'upload')->name('ajax_upload');
    Route::rule('routeSearch', 'routeSearch')->name('ajax_route_search');
    Route::rule('editorUpload', 'editorUpload')->name('ajax_editor_upload');
})->prefix('admin/ajax/');

Route::group('general/profile', function () {
    Route::rule('index', 'index')->name('admin_profile_index');
    Route::rule('changepassword', 'changepassword')->name('admin_profile_changepassword');
})->prefix('admin/general.profile/');


//权限
Route::group('auth', function () {
    //菜单
    Route::group('rule', function () {
        Route::rule('index', 'index')->name('auth_rule_index');
        Route::rule('add', 'add')->name('auth_rule_add');
        Route::rule('edit', 'edit')->name('auth_rule_edit');
        Route::rule('del', 'del')->name('auth_rule_del');
        Route::rule('multi', 'multi')->name('auth_rule_multi');
    })->prefix('admin/auth.rule/');

    Route::group('group', function () {
        Route::rule('index', 'index')->name('auth_group_index');
        Route::rule('add', 'add')->name('auth_group_add');
        Route::rule('edit', 'edit')->name('auth_group_edit');
        Route::rule('del', 'del')->name('auth_group_del');
        Route::rule('multi', 'multi')->name('auth_group_multi');
        Route::rule('ruleList', 'ruleList')->name('auth_group_ruleList');
    })->prefix('admin/auth.group/');

    Route::group('admin', function () {
        Route::rule('index', 'index')->name('auth_admin_index');
        Route::rule('add', 'add')->name('auth_admin_add');
        Route::rule('edit', 'edit')->name('auth_admin_edit');
        Route::rule('del', 'del')->name('auth_admin_del');
        Route::rule('destroy', 'destroy')->name('auth_admin_destroy');
        Route::rule('restore', 'restore')->name('auth_admin_restore');
        Route::rule('recycleBin', 'recycleBin')->name('auth_admin_recycleBin');
    })->prefix('admin/auth.admin/');

});

Route::group('content', function () {
    //栏目
    Route::group('column', function () {
        Route::rule('index', 'index')->name('content_column_index');
        Route::rule('add', 'add')->name('content_column_add');
        Route::rule('edit', 'edit')->name('content_column_edit');
        Route::rule('del', 'del')->name('content_columnn_del');
        Route::rule('destroy', 'destroy')->name('content_column_destroy');
        Route::rule('restore', 'restore')->name('content_column_restore');
        Route::rule('recycleBin', 'recycleBin')->name('content_column_recycleBin');
    })->prefix('admin/content.column/');
    //文章
    Route::group('article', function () {
        Route::rule('index', 'index')->name('content_article_index');
        Route::rule('add', 'add')->name('content_article_add');
        Route::rule('edit', 'edit')->name('content_article_edit');
        Route::rule('del', 'del')->name('content_articlen_del');
        Route::rule('destroy', 'destroy')->name('content_article_destroy');
        Route::rule('restore', 'restore')->name('content_article_restore');
        Route::rule('recycleBin', 'recycleBin')->name('content_article_recycleBin');
        Route::rule('tags', 'tags')->name('content_article_getTags');
    })->prefix('admin/content.article/');
});

//网站配置
Route::group('webconfig', function () {
    //动态配置
    Route::group('webconfig', function () {
        Route::rule('index', 'index')->name('webconfig_webconfig_index');
        Route::rule('add', 'add')->name('webconfig_webconfig_add');
        Route::rule('edit', 'edit')->name('webconfig_webconfig_edit');
        Route::rule('del', 'del')->name('webconfig_webconfig_del');
        Route::rule('destroy', 'destroy')->name('webconfig_webconfig_destroy');
        Route::rule('restore', 'restore')->name('webconfig_webconfig_restore');
        Route::rule('recycleBin', 'recycleBin')->name('webconfig_webconfig_recycleBin');
    })->prefix('admin/webconfig.webconfig/');
    //轮播图管理
    Route::group('carousel', function () {
        Route::rule('index', 'index')->name('webconfig_carousel_index');
        Route::rule('add', 'add')->name('webconfig_carousel_add');
        Route::rule('edit', 'edit')->name('webconfig_carousel_edit');
        Route::rule('del', 'del')->name('webconfig_carousel_del');
        Route::rule('destroy', 'destroy')->name('webconfig_carousel_destroy');
        Route::rule('restore', 'restore')->name('webconfig_carousel_restore');
        Route::rule('recycleBin', 'recycleBin')->name('webconfig_carousel_recycleBin');
    })->prefix('admin/webconfig.carousel/');

    Route::group('friendlink', function () {
        Route::rule('index', 'index')->name('webconfig_friendlink_index');
        Route::rule('add', 'add')->name('webconfig_friendlink_add');
        Route::rule('edit', 'edit')->name('webconfig_friendlink_edit');
        Route::rule('del', 'del')->name('webconfig_friendlink_del');
        Route::rule('destroy', 'destroy')->name('webconfig_friendlink_destroy');
        Route::rule('restore', 'restore')->name('webconfig_friendlink_restore');
        Route::rule('recycleBin', 'recycleBin')->name('webconfig_friendlink_recycleBin');
        Route::rule('multi', 'multi')->name('webconfig_friendlink_multi');
    })->prefix('admin/webconfig.friendlink/');

    Route::group('frontmenu', function () {
        Route::rule('index', 'index')->name('webconfig_frontmenu_index');
        Route::rule('add', 'add')->name('webconfig_frontmenu_add');
        Route::rule('edit', 'edit')->name('webconfig_frontmenu_edit');
        Route::rule('del', 'del')->name('webconfig_frontmenu_del');
        Route::rule('destroy', 'destroy')->name('webconfig_frontmenu_destroy');
        Route::rule('restore', 'restore')->name('webconfig_frontmenu_restore');
        Route::rule('recycleBin', 'recycleBin')->name('webconfig_frontmenu_recycleBin');
        Route::rule('multi', 'multi')->name('webconfig_frontmenu_multi');

    })->prefix('admin/webconfig.frontmenu/');

    Route::group('tools', function () {
        Route::rule('index', 'index')->name('webconfig_tools_index');
        Route::rule('add', 'add')->name('webconfig_tools_add');
        Route::rule('edit', 'edit')->name('webconfig_tools_edit');
        Route::rule('del', 'del')->name('webconfig_tools_del');
        Route::rule('destroy', 'destroy')->name('webconfig_tools_destroy');
        Route::rule('restore', 'restore')->name('webconfig_tools_restore');
        Route::rule('recycleBin', 'recycleBin')->name('webconfig_tools_recycleBin');
        Route::rule('multi', 'multi')->name('webconfig_tools_multi');

    })->prefix('admin/webconfig.tools/');


});

Route::get('captcha/[:s]', '\\think\\captcha\\CaptchaController@index');

